package com.ycrlkj.android.modulescore.main.apiservice;

import com.ycrlkj.android.modulescore.main.entity.Address;
import com.ycrlkj.android.modulespublic.common.net.response.MResponse;
import com.ycrlkj.android.modulespublic.common.net.response.ResultData;
import java.util.List;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;


/**
 * 复制此类时说明:
 * 注意: 每新增一个 XXXXApiService 文件需要向 BaseApiService 中添加一个注入的生产者
 */
public interface AddressApiService {

    @POST("address/add")
    Observable<MResponse<ResultData>> add(@Body Address address);

    @GET("address/getAllByUserId/{userId}")
    Observable<MResponse<List<Address>>> getAllByUserId(@Path("userId") String userId);

    @GET("address/getById/{id}")
    Observable<MResponse<Address>> getById(@Path("id") String id);

    @DELETE("address/deleteById/{id}")
    Observable<MResponse<ResultData>> deleteById(@Path("id") String id);

    @POST("address/deleteBatch")
    Observable<MResponse<ResultData>> deleteBatch(@Body List<String> ids);

    @PUT("address/edit")
    Observable<MResponse<ResultData>> edit(@Body Address address);

}
